import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import { fileURLToPath, URL } from 'node:url';

///nvm 18
export default defineConfig({
  plugins: [vue()],
  server: {
    open: true,
    host: '0.0.0.0'	,
    https: true,
    port: 5173
  },
  build: {
    minify: 'esbuild', // 使用 esbuild 替代 terser
    rollupOptions: {
      input: {
        main: fileURLToPath(new URL('./index.html', import.meta.url)),
      },
    },
  },
  resolve: {
    alias: {
      '@': fileURLToPath(new URL('./src', import.meta.url)),
    },
  },
});